import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index/Index.vue'),
    children: [
      {
        path: '/index',
        name: 'homepage',
        component: () => import('../views/homepage/homepage.vue')
    },
    {
      path: '/realtimeinfo',
      name: 'realtimeinfo',
      component: () => import('../views/RealTimeInfo/realtimeinfo.vue')
  },
  {
    path: '/activity',
    name: 'activity',
    component: () => import('../views/Activity/activity.vue')
},
      {
        path: '/personalcenter',
        name: 'personalcenter',
        component: () => import('../views/personalcenter/PersonalCenter.vue')
    },
  ]
  },
  {
    path: '/enroll',
    name: 'enroll',
    component: () => import('../views/enroll/Enroll.vue')
  },
  {
    path: '/enrolllist',
    name: 'enrolllist',
    component: () => import('../views/enroll/EnrollList.vue')
  },
  {
    path: '/activity-list',
    name: 'activity-list',
    component: () => import('../views/personalcenter/ActivityList.vue')
  },
  {
    path: '/activitylist',
    name: 'activitylist',
    component: () => import('../views/Activity/ActivityList.vue')
  },
  {
    path: '/partake',
    name: 'partake',
    component: () => import('../views/personalcenter/partake.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
